//
//  YSZHomeTitleButton.swift
//  swiftweibo6
//
//  Created by ysz on 15/11/28.
//  Copyright © 2015年 user. All rights reserved.
//

import UIKit

class YSZHomeTitleButton: UIButton {

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    init(title: String)
    {
        super.init(frame: CGRectZero)
        
        self.setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        
        self.setTitle(title, forState: UIControlState.Normal)
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        self.sizeToFit()
    }
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x=0
        imageView?.frame.origin.x = titleLabel!.frame.width + 3
    }

    

}
